home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / Gfx / Edit / TSMorph / src / sprintf.c < prev    next >
C/C++ Source or Header  |  1994-10-30  |  2KB  |  48 lines

  1. // TSMorph - Amiga Morphing program
  2. // Copyright (C) © 1993  Topicsave Limited
  3.  
  4. // This program is free software; you can redistribute it and/or modify
  5. // it under the terms of the GNU General Public License as published by
  6. // the Free Software Foundation; either version 2 of the License, or
  7. // any later version.
  8.  
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. // GNU General Public License for more details.
  13.  
  14. // You should have received a copy of the GNU General Public License
  15. // along with this program; if not, write to the Free Software
  16. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. // mpaddock@cix.compulink.co.uk
  19.  
  20. // sprintf() using RawDoFmt()
  21.  
  22. #include <proto/exec.h>
  23. #include <stdarg.h>
  24. //#include <stdio.h>
  25.  
  26. int sprintf(char *buffer,char *ctl, ...)
  27. {
  28.    va_list args;
  29.  
  30.    va_start(args, ctl);
  31.  
  32.    /*********************************************************/
  33.    /* NOTE: The string below is actually CODE that copies a */
  34.    /*       value from d0 to A3 and increments A3:          */
  35.    /*                                                       */
  36.    /*          move.b d0,(a3)+                              */
  37.    /*          rts                                          */
  38.    /*                                                       */
  39.    /*       It is essentially the callback routine needed   */
  40.    /*       by RawDoFmt.                                    */
  41.    /*********************************************************/
  42.  
  43.    RawDoFmt(ctl, args, (void (*))"\x16\xc0\x4e\x75", buffer);
  44.  
  45.    va_end(args);
  46.  
  47.    return 0;
  48. }